package com.x.chat.controller;

import com.x.chat.pojo.ChatItem;
import com.x.chat.service.ChatService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ChatController {
    @Autowired
    private ChatService chatService;

    @PostMapping("/sendMessage")
    public String sendMessage(@RequestBody ChatItem rcvChatItem) {
        chatService.addChat(rcvChatItem);
        return "";
    }
}
